﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SmallJob.Data;
using SmallJob.Data.Interfaces;
using SmallJob.Model;
using SmallShop.Services.Interfaces;

namespace SmallShop.Services.Implements
{
    public class SkillService: RepositoryBase<Skill>,ISkillService
    {
        public SkillService(IDatabaseFactory DbFactory)
            : base(DbFactory)
        { }
        public List<String> GetAllSkillName(string search) {
            return (from s in SmallJobDB.Skills
                    where s.Name.ToUpper().Contains(search.ToUpper())
                    select s.Name).ToList();
        }
        public Boolean IsExist(string name) {
            var sk = (from s in SmallJobDB.Skills
                      where s.Name == name
                      select s).FirstOrDefault();
            return sk != null;
        }
    }
}
